package com.evaluate;

/**
 * @author mayixiang
 * @date 2021-02-18 13:18
 */
public class StateMachine extends State{

    private State startState;
    private State evaluateState;
    private State checkState;
    private State rptState;
    private State endState;

    private State state;

    public StateMachine(){
        startState = new StartState(this);
        evaluateState = new EvaluateState(this);
        checkState = new CheckState(this);
        rptState = new RptState(this);
        endState = new EndState(this);
        state = startState;
    }

    @Override public void start() {
        state.start();
    }

    @Override public void evaluate() {
        state.evaluate();
    }

    @Override public void check() {
        state.check();
    }

    @Override public void rpt() {
        state.rpt();
    }

    @Override public void end() {
        state.end();
    }
}
